<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE html>
<html>
<head>
<base href="${basePath}">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>故障处理</title>
<meta name="viewport" content="initial-scale=1, maximum-scale=1">
<link rel="shortcut icon" href="/favicon.ico">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">

<link rel="stylesheet"
	href="//g.alicdn.com/msui/sm/0.6.2/css/sm.min.css">
<link rel="stylesheet"
	href="//g.alicdn.com/msui/sm/0.6.2/css/sm-extend.min.css">
	<jsp:include page="../inc/head.jsp" />
</head>
<body>
	<jsp:include page="../inc/header.jsp" />
	<%-- <header class="bar bar-nav">
		 <h1 class='title'>${appName}-移动端首页</h1> 
		
	</header> --%>
	<div class="content">
		<div class="content-block">
		<br>
		<div class="am-cf am-padding am-padding-bottom-0">
					<div class="am-fl am-cf">
						<strong class="am-text-primary am-text-lg">${pagetitle}</strong> /
						<small>${subtitle}</small>
					</div>
				</div>

				<hr>
			<!-- <h2>测试提交信息功能</h2>
			<p>测试提交信息功能</p>
			<p>
				<a href="5/irdc.do"
					class="button button-big">测试提交信息功能</a>
			</p>	 -->	
		
			<div class="am-g wxapi_container">
				<div class="am-u-sm-12 lbox_close wxapi_form">

					<table
						class="am-table am-table-striped am-table-hover table-main">
						<thead>
							<tr>
								<th>序号</th>
								<th>设施</th>
								<th>故障名称</th>
								<th>操作</th>
							</tr>
						</thead>
						<tbody>
							<c:forEach var="it" items="${list}" varStatus="index">
							
								<tr id="${it.eventId}">
									<td>${index.count+1}</td>
									<td>${it.facDes}</td>
									<td >${it.faultName}</td>
									<td>
										<div class="am-btn-toolbar">
											<div class="am-btn-group am-btn-group-xs">
												<a onclick="modifyFault(${it.eventId})" class="am-btn am-btn-default am-btn-xs am-text-secondary"><span class="am-icon-map-qrcode"></span>处理完成上报</a>
											</div>
										</div>
									</td>
								</tr>
							</c:forEach>
						</tbody>
					</table>
					
					<hr />
				</div>
			</div>
			
		</div>
	</div>
	
	<script type='text/javascript'
		src='//g.alicdn.com/sj/lib/zepto/zepto.min.js' charset='utf-8'></script>
	<script type='text/javascript'
		src='//g.alicdn.com/msui/sm/0.6.2/js/sm.min.js' charset='utf-8'></script>
	<script type='text/javascript'
		src='//g.alicdn.com/msui/sm/0.6.2/js/sm-extend.min.js' charset='utf-8'></script>
	
	<script type="text/javascript">
		//这段script用来去一些不能再js文件里直接取但是又要在纯js文件里用的值
		
		var roleId="${sessionScope.user.role_id}";
		var mbasePath ="${basePath}";
		
		function modifyFault(eventId){
			$.ajax({
				type:"post",
				dataType:"json",
				cache:false,
				data:{"eventId":eventId},
				url:mbasePath+"/ajaxmodifyfault",
				success:function(data){
					alert("故障处理完成");
					$("#"+eventId).prop("hidden","true");
				}
			});
		}
	</script>

</body>
</html>